# Maintainer: David Runge <dvzrv@archlinux.org>

_name=lazr.delegates
pkgname=python-lazr.delegates
pkgver=2.1.0
pkgrel=2
pkgdesc="Easily write objects that delegate behavior"
arch=(any)
url="https://launchpad.net/lazr.delegates"
license=(LGPL3)
depends=(
  python
  python-setuptools  # pkg_resources is used to declare namespaces
  python-zope-interface
)
makedepends=(
  python-build
  python-installer
  python-wheel
)
checkdepends=(python-pytest)
source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz{,.asc})
sha512sums=('e8e081d71afed32aa8b8e898268d1e4a33be6bbdcad7778dfb000b9ad600ae9922032b6d13d066c55106ea403a5a25340fb9f8e1fe3ee246732247cbb3fd108b'
            'SKIP')
b2sums=('b8c9a1f0b473162560a21fc4ea7553786cb38f94ed7da63ccd740f5cd49b566ad5a0ba86270d062aed08dfe67dfc33708252a7761783bdeadb99a6ca1452a0c0'
        'SKIP')
validpgpkeys=(
  'AC0A4FF12611B6FCCF01C111393587D97D86500B'  # Colin Watson <cjwatson@chiark.greenend.org.uk>
  '760D8F2C93E9CA8562E4A00E75D673C2DD1FB761'  # Jürgen Gmach <juergen.gmach@canonical.com>
)

build() {
  cd $_name-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_name-$pkgver
  pytest -v
}

package() {
  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 {CONTRIBUTING,NEWS,README}.rst -t "$pkgdir/usr/share/doc/$pkgname/"
}
